package RedPacket;

import java.util.ArrayList;
import java.util.List;
import java.util.Random;

public class Normal extends User{
    public Normal(String name, float money) {
        super(name, money);
    }

    public void receiveRedPacket(ArrayList<Float> list){
        //从list当中抽取一个
        int index = new Random().nextInt(list.size());

        //从list当中删除被拿走的那个元素,并且将它加到余额里
        float delta = list.remove(index);
        setMoney(delta+getMoney());
    }



}
